Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

In my project, I want disable the Backspace button in IE.

Because, the after logout, the user press back/backspace button. it goes last accessed page.


thanks.
Posted
Comments
Abhishek Sur 6-Jul-10 17:14pm    
I think you are talking about Back Button (history.Back). Backspace is a keyboard button, there is nothing to deal with backspace with logouts.

Hi,

You can use either server side solution or client side (javascript solution)

Server side


After logging out use this code
VB
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)


client side


include the following text in the head portion of each page.

XML
<script>
    history.forward();
</script>


hope this will help.

Thanks
 
Share this answer
 
VB
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)
 
Share this answer
 
Response.Cache.SetExpires(DateTime.Now.AddDays(-1))
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetAllowResponseInBrowserHistory(False)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900